package com.bgybmi.controller.home;

import com.bgybmi.controller.BaseController;
import com.bgybmi.util.Utility;

public class HomeIndexController extends BaseController{
  
	//1.base view
    /**
     *1.tab row
     * 1.1get Userfrom Cookie
     * 1.2verify jsticket
     */	
	public void index(){		
		//renderText("进入系统");
		renderJsp("index.jsp");
	}
		
	// -->url+/hello 
	//2.view route  
	//2.1 行政服务
	//3.is we need custom msg
	public void meeting(){				
		render("meet/index。jsp");
	} 
	
	public void repairing(){
	    render("repair/index.jsp");
	}
    // renderJsp("/WEB-INF/content/common/result.jsp");
	
	public void sale(){
		 renderJsp("sale/index.jsp");
	}
    
	public void car(){
	   	renderJsp("car/index.jsp");
	}
	
	public void xzdy(){
		renderJsp("xzdy/index.jsp");
	}
	
	public void taskdeal(){
		renderJsp("taskdeal/index.jsp");
	}
	
	public void im(){
		renderJsp("im/index.jsp");
	}
	
	public void rc(){
		renderJsp("rc/index.jsp");
	}
	
	public void assessment(){
		renderJsp("assessment/index.jsp");
	}	
	//3.function Json set
	
	public void fun(){		
		renderJson();
	}
	
	//4.授权页面进入
	//  https://open.weixin.qq.com/connect/oauth2/authorize?appid=CORPID&redirect_uri=REDIRECTURI&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect
	public void oathOrder(){
		String user=getSessionAttr("loginuser");
		String url="http://" + getRequest().getServerName()+"/meet";
		if(Utility.empty(user)){		
			url=getOathUrl(url);
		}	
		System.out.println(url);
		redirect(url);		
	}
	
	public void oathMyMeet(){
		String user=getSessionAttr("loginuser");
		String url="http://" + getRequest().getServerName()+"/meet/rcnav";
		if(Utility.empty(user)){			
			url=getOathUrl(url);
		}
		redirect(url);	
	}

	public void oathSub(){
		String suburl=getPara("suburl");
		String user=getSessionAttr("loginuser");
		String url="http://" + getRequest().getServerName()+"/"+suburl;
		if(Utility.empty(user)){			
			url=getOathUrl(url);
		}
		redirect(url);	
	}
	
	public void oathMeetingInfo(){
		String user=getSessionAttr("loginuser");
		String url="http://" + getRequest().getServerName()+"/meet";
		if(Utility.empty(user)){			
			url=getOathUrl(url);
		}
		redirect(url);	
	}
	
	
}	